feat: bash tool execution in background#10285
Merged
sestinj merged 18 commits intocontinuedev:mainfrom Feb 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
4 issues found across 20 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/cli/src/ui/JobsSelector.tsx">
<violation number="1" location="extensions/cli/src/ui/JobsSelector.tsx:49">
P2: Polling effect uses a stale closure: viewMode/selectedJob aren’t in the dependency array, so the interval never sees updates and detail view auto-refresh won’t run.</violation>
</file>
<file name="extensions/cli/src/tools/runTerminalCommand.ts">
<violation number="1" location="extensions/cli/src/tools/runTerminalCommand.ts:225">
P2: After moving the process to background, stdout/stderr/data listeners are never detached, so they keep appending to captured buffers and updating chat history even though the tool call is resolved, causing memory growth and spurious updates.</violation>
<violation number="2" location="extensions/cli/src/tools/runTerminalCommand.ts:242">
P2: Backgrounding a command returns unbounded stdout without applying the existing truncation limits, which can overflow context if the process has produced large output before backgrounding.</violation>
</file>
<file name="extensions/cli/src/services/BackgroundJobService.ts">
<violation number="1" location="extensions/cli/src/services/BackgroundJobService.ts:72">
P2: Output capture decodes each Buffer chunk with toString(), which can corrupt multi‑byte characters split across chunks. Use StringDecoder or setEncoding on the streams to preserve UTF‑8 sequences across chunk boundaries.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Add missing import for backgroundJobService in services/index.ts
- Add explicit type annotation for BackgroundJob parameter in checkBackgroundJob.ts
- Fix stale closure in JobsSelector useEffect by adding viewMode/selectedJob to deps
- Truncate stdout when moving command to background to prevent context overflow
- Detach stdout/stderr listeners after backgrounding to prevent memory growth
- Use setEncoding('utf8') on streams to prevent multi-byte character corruption
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The tsconfig uses baseUrl: "." which allows imports like "src/..." to resolve correctly for tsc, but vitest doesn't read tsconfig paths by default. This adds a resolve.alias to map "src" to the actual source directory so tests can resolve these imports. Fixes ToolPermissionService test failures (TypeError: ToolPermissionService is not a constructor) caused by failed module resolution of "src/..." paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ToolPermissionService imported ALL_BUILT_IN_TOOLS from allBuiltIns.ts, which imports runTerminalCommand.ts, which imports services/index.ts, which imports ToolPermissionService.ts - creating a circular dependency. This caused "ToolPermissionService is not a constructor" errors in tests because the module wasn't fully initialized when services/index.ts tried to instantiate it. Fix: Extract a lightweight builtInToolNames.ts with just the string names (no heavy imports) and use that in ToolPermissionService instead. Also add a vitest resolve alias for "src/" paths to match tsconfig baseUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sestinj
approved these changes
Feb 18, 2026
Contributor
|
awesome work! i think all that stuff was failing on the main branch too but i just went ahead and cleaned it up here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces moving terminal command to run in the background
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
feat.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Continue Tasks:▶️ 1 queued — View all
Summary by cubic
Run Bash tool commands in the background from the CLI. Press Ctrl+B to background a running command, stream foreground output, and monitor jobs via /jobs or the CheckBackgroundJob tool (background output capped at 1000 lines).
New Features
Bug Fixes
Written for commit 87a0464. Summary will update on new commits.